package Thread;
//wait与notify
public class Demo16 {
    public static void main(String[] args) throws InterruptedException {
        Object object=new Object();
        Thread t=new Thread(()->{
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            synchronized (object){
                System.out.println("进行通知");
                object.notify();
            }
        });
        t.start();
        System.out.println("wait之前");
        synchronized (object){
            object.wait();
        }
        System.out.println("wait之后");
    }
}
